import requests

def check_update(current_version):
    response = requests.get(f'http://127.0.0.1:5000/api/check_update?version={current_version}')
    if response.status_code == 200:
        data = response.json()
        if data['update_available']:
            print(f"Update available: Latest version {data['latest_version']}, Download URL: {data['download_url']}")
        else:
            print("No update available")
    else:
        print(f"Failed to check update: {response.status_code}, {response.text}")

# if __name__ == '__main__':
#     check_update('1.0.0')
